View.vue
<template>
  <h1>单选组件</h1>
  <el-radio-group v-model="edu">
    <el-radio value="初中" label="学历:初中"></el-radio>
    <el-radio value="高中" label="学历:高中"></el-radio>
    <el-radio value="本科" label="学历:本科"></el-radio>
    <el-radio value="硕士研究生" label="学历:硕士研究生"></el-radio>
    <el-radio value="博士研究生" label="学历:博士研究生"></el-radio>
  </el-radio-group>
    <h4>您选择的学历是:{{edu}}</h4>
  <hr>
  <el-radio-group v-model="pri">
    <el-radio-button v-for="pro in pros" :value="pro.price" :label="pro.title"></el-radio-button>
  </el-radio-group>
  <h4>您选择的商品价格为:{{pri}}</h4>
</template>

<script setup>
  import {ref} from "vue";

  const edu = ref('本科');

  const pros = ref([
    {title:'茅台',price:3950},
    {title:'五粮液',price:2950},
    {title:'梦之蓝',price:1950},
    {title:'汾酒',price:950}
  ])
  const pri = ref(3950);

</script>

<style scoped>

</style>